﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TX.Core;
using TX.Core.Security;
using TX.Passport.Models;
using TX.Passport.Repositories;

namespace TX.Passport.Persist
{
    /// <summary>
    /// 安全主体存储库
    /// </summary>
    public class PrincipalRepository : PassportRepository<Principal>, IPrincipalRepository
    {   
        
        public IQueryable<Principal> GetPrincipals(QueryOption<Principal> option = null)
        {
            return this.PersistService.GetQuery(option);
        }

        public Principal AddPrincipal(Principal model)
        {
            return this.PersistService.Add(model);
        }

        public void RemovePrincipal(Principal model)
        {
            this.PersistService.Remove(model);
        }

        public void UpdatePrincipal(Principal model)
        {
            this.PersistService.Update(model);
        }
    }
}